package permission

import (
	"github.com/ifnk/micro-blog/internal/pkg/dbcontext"
	"github.com/ifnk/micro-blog/internal/pkg/log"
	"github.com/ifnk/micro-blog/protobuf/permission_pb"
)

func NewAuthorityServer(logger *log.Logger, db *dbcontext.GormDB, jinzhuDB *dbcontext.JinZhuDB) AuthorityServer {
	return AuthorityServer{
		logger:                        logger,
		db:                            db,
		AuthorityServiceDefaultServer: permission_pb.AuthorityServiceDefaultServer{DB: jinzhuDB.DB},
	}
}

type AuthorityServer struct {
	permission_pb.AuthorityServiceDefaultServer
	logger *log.Logger
	db     *dbcontext.GormDB
}
